
export const parseFormData  = obj => Object.keys(obj).reduce((r, k) => r.append(k, obj[k]) || r, new FormData());

export const postMethod     = (entity = {}, parse = parseFormData) => ({method: 'POST', body: parse(entity)});

export const transform      = fn => r => Object.assign(r, {data: _.map(r.data, fn)});
